import logging
import redis

class Config(object):
    SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"

    DEBUG = True

    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/python28_html"
    SQLALCHEMY_TRACK_MODIFICATIONS = True

    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = "6379"

    SESSION_TYPE = "redis"
    SESSION_USE_SIGNER = True
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400

    LOG_LEVEL = logging.DEBUG

class DevelopmentConfig(Config):
    pass


class ProductionConfig(Config):

    DEBUG = False

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/python28_html_pro'


class UnittestConfig(Config):

    TESTING = True

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/python28_html_cast'


configs = {
    'dev':DevelopmentConfig,
    'pro':ProductionConfig,
    'unit':UnittestConfig
}


